<template>
  <el-row>
    <el-col :span="24">
      <el-row style="background: #3b8cf4">
        <el-col :offset="3" :span="6" class="logo">
          <img src="../../assets/home/logo1.svg" />
        </el-col>
      </el-row>
    </el-col>
    <el-col :span="24">
      <menutree ref="menutree"></menutree>
    </el-col>
  </el-row>
</template>

<script>
import menutree from "@/view/compents/menutree.vue";
export default {
  name: "navTabs",
  components: {
    menutree,
  },
  props: {},
  data() {
    return {
      input: "",
      se_active: 1,
      data: null,
      url: {
        getVarietyList: "/web/program/getVarietyList",
      },
    };
  },
  created() {
    this.getVarietyList();
  },
  methods: {
    switchType(type) {
      this.se_active = type;
      this.getVarietyList();
    },
    async getVarietyList(name) {
      sessionStorage.removeItem("index");
      sessionStorage.removeItem("kindId");
      sessionStorage.removeItem("programId");
      sessionStorage.setItem("type", this.se_active);
      let params = {};
      if (this.input.length > 0) {
        params.name = this.input;
      }
      if (this.input && this.input.length > 0) {
        params.name = this.input;
      }
      this.$nextTick(() => {
        this.$refs.menutree.dataList = [];
      });
      let res = await this.$http.get(this.url.getVarietyList, params);
      this.data = res.data.result;
      this.$nextTick(() => {
        this.$refs.menutree.load(this.data);
      });
    },
  },
};
</script>

<style lang="scss" scoped="scoped">
.positor {
  cursor: pointer;
}

.navSelect {
  text-align: center;
  color: #ffffff;
  height: 5vh;
  line-height: 5vh;
  font-size: 19px;

  .se_active {
    background-color: #3b8cf4;
  }
}

.logo {
  margin-top: 1vh;
  margin-bottom: 1vh;
  text-align: center;
  img {
    height: 3vh;
  }
}

.name {
  height: 7vh;
  margin-top: 4vh;
  color: #ffffff;

  .titleName {
    font-size: 125%;
    font-weight: bold;
    height: 2.5vh;
    line-height: 2.5vh;
    letter-spacing: 7px;
  }

  .titleHref {
    font-size: 70%;
    font-weight: bold;
    height: 3vh;
    line-height: 3vh;
  }
}

.search_input {
  padding: 1vh 0 2vh 0;

  .el-input__inner {
    background-color: #0f1b35 !important;
    border-color: #0f1b35;
    height: 4vh !important;
    line-height: 4vh;
    font-size: 15px;
    color: #ffffff;
  }
}
</style>
